/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package rentcar.datasender.models;
 
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author wuhao
 */
public class CarPosData {

        /*
        "time": "2014-06-12 09:47:05",
        "latitude": "30.46262",
        "longitude": "114.4243",
        "speed": "0",//速度，除以10之后单位是 km/h
        "direction": "0",//方向角
        "islocation": "0"//信号是否正常，0为正常，1为不正常
         */
        private String time;
        private double latitude;
        private double longitude;
        private double speed;
        private double direction;
        private Integer islocation;

        /**
         * @return the time
         */
        public String getTime() {
                return time;
        }

        /**
         * @param time the time to set
         */
        public void setTime(Date time) {
                DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                this.time = df.format(time);;
        }

        /**
         * @return the lat
         */
        public double getLat() {
                return latitude;
        }

        /**
         * @param lat the lat to set
         */
        public void setLat(double lat) {
                this.latitude = lat;
        }

        /**
         * @return the lon
         */
        public double getLon() {
                return longitude;
        }

        /**
         * @param lon the lon to set
         */
        public void setLon(double lon) {
                this.longitude = lon;
        }

        /**
         * @return the speed
         */
        public double getSpeed() {
                return speed;
        }

        /**
         * @param speed the speed to set
         */
        public void setSpeed(double speed) {
                this.speed = speed;
        }

        /**
         * @return the direction
         */
        public double getDirection() {
                return direction;
        }

        /**
         * @param direction the direction to set
         */
        public void setDirection(double direction) {
                this.direction = direction;
        }

        /**
         * @return the islocation
         */
        public Integer getIslocation() {
                return islocation;
        }

        /**
         * @param islocation the islocation to set
         */
        public void setIslocation(Integer islocation) {
                this.islocation = islocation;
        }
}
